// "url": "http://plm.muxin.com:80/Windchill/servlet/rest/hzero/pmgt/taskbook/showTaskBookInfoTable",
import { request } from "@/utils/request";
let userinfo = JSON.parse(sessionStorage.getItem('userInfo'))
let userId = ''
let organizationId = 0;
if (userinfo) {
    organizationId = userinfo.tenantId
    userId = userinfo.loginName
}
export const api = {
  showTaskBookInfoTable: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/showTaskBookInfoTable",
  getTaskBookByProject: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookByProject",
  hasCreatePermission: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/hasCreatePermission",
  hasEditTaskBookPermission: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/hasEditTaskBookPermission",
  downloadTaskBookTemplate: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/downloadTaskBookTemplate",
  createTaskBookShowTable: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/createTaskBookShowTable",
  getTaskBookKeyNode: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookKeyNode",
  importPlanKeyNode: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/importPlanKeyNode",
  getTaskBookDefaultNumber: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookDefaultNumber",
  getTaskBookPatentLayout: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookPatentLayout",
  getTaskBookAnalysis: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookAnalysis",
  searchIndexTemplate: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/searchIndexTemplate",
  getSubTypes: "/project/Windchill/servlet/rest/hzero/pdm/attribute/getSubTypes",
  importPatentLayout: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/importPatentLayout",
  getTaskBookMainIndex: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookMainIndex",
  getTaskBookPatentIndex: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookPatentIndex",
  getTaskBookDigitalUpgradeIndex: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookDigitalUpgradeIndex",
  getTaskBookStandardIndex: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookStandardIndex",
  getTaskBookTestDetection: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookTestDetection",
  taskBookDefaultPatent: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/taskBookDefaultPatent",
  taskBookDefaultStandardIndex: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/taskBookDefaultStandardIndex",
  taskBookDefaultDigitalIndex: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/taskBookDefaultDigitalIndex",
  taskBookDefaultBudget: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/taskBookDefaultBudget",
  taskBookDefaultSchedule: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/taskBookDefaultSchedule",
  taskBookDefaultKeyNode: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/taskBookDefaultKeyNode",
  downloadPatentLayoutTemplate: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/downloadPatentLayoutTemplate",
  getTaskBookSchedulePlan: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookSchedulePlan",
  getProjectBudget: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getProjectBudget",
  getTaskBookNumber: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getTaskBookNumber",
  create: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/create",
  edit: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/edit",
  // preview: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/preview",
  preview: "project/Windchill/servlet/rest/hzero/pmgt/taskbook/previewTaskBook",
  getVersionHistory: "/project/Windchill/servlet/rest/hzero/pdm/core/getVersionHistory",
  TaskBookAttachmentInfo: "/project/Windchill/servlet/rest/hzero/pdm/core/getAttachmentInfo",
  downloadAttachmentFile: "/project/Windchill/servlet/rest/hzero/pdm/core/downloadAttachmentFile",
  reEsignature: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/reEsignature",
  undoCheckOut: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/undoCheckOut",
  hasDeletePermission: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/hasDeletePermission",
  reviseTaskBook: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/reviseTaskBook",
  exportTaskBook: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/exportTaskBook",
  importTaskBook: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/importTaskBook",
  deleteTaskBook: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/deleteTaskBook",
  getAllRoles: "/project/Windchill/servlet/rest/hzero/pmgt/team/getAllRoles",
  getFourthActivities: "/deliver/Windchill/servlet/rest/hzero/pmgt/plan/getFourthActivities",
  budgetTableInfo: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/budgetTableInfo",
  checkoutObj: "/project/Windchill/servlet/rest/hzero/pdm/core/checkoutObj",
  isCheckIn: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/isCheckIn",
  getAnalysisRootNodes: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getAnalysisRootNodes",
  hasChildren: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/hasChildren",
  getAnalysisNodes: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getAnalysisNodes",
  importPlanWBSNode: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/importPlanWBSNode",
  hasReviseTaskBookPermission: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/hasReviseTaskBookPermission",
  getProductCategories: "/project/Windchill/servlet/rest/hzero/pmgt/taskbook/getProductCategories",
  creatorMake: "/workflow/Windchill/servlet/rest/hzero/foundation/workflow/completeRunningWorkItemBySelf",
};
// 是否可以修订
export function hasReviseTaskBookPermission(parameter) {
  return request({
    url: api.hasReviseTaskBookPermission,
    method: 'post',
    data: parameter
  })
}
// 获取产品类别列表
export function getProductCategories(parameter) {
  return request({
    url: api.getProductCategories,
    method: 'post',
    data: parameter
  })
}
// 获取分析项产品类型
export function getAnalysisRootNodes(parameter) {
  return request({
    url: api.getAnalysisRootNodes,
    method: 'post',
    data: parameter
  })
}
// 进度计划 导入计划的任务
export function importPlanWBSNode(parameter) {
  return request({
    url: api.importPlanWBSNode,
    method: 'post',
    data: parameter
  })
}
// 分析项是否有下一层级
export function hasChildren(parameter) {
  return request({
    url: api.hasChildren,
    method: 'post',
    data: parameter
  })
}
// 获取分析项
export function getAnalysisNodes(parameter) {
  return request({
    url: api.getAnalysisNodes,
    method: 'post',
    data: parameter
  })
}
// 获取四级汇总节点
export function getFourthActivities(parameter) {
  return request({
    url: api.getFourthActivities,
    method: 'post',
    data: parameter
  })
}
// 获取项目任务书-项目预算表头
export function budgetTableInfo(parameter) {
  return request({
    url: api.budgetTableInfo,
    method: 'post',
    data: parameter
  })
}
// 将对象置为检出状态
export function checkoutObj(parameter) {
  return request({
    url: api.checkoutObj,
    method: 'post',
    data: parameter
  })
}
// 获取是检出状态还是检入
export function isCheckIn(parameter) {
  return request({
    url: api.isCheckIn,
    method: 'post',
    data: parameter
  })
}
// 导出任务书
export function exportTaskBook(parameter) {
  return request({
    url: api.exportTaskBook,
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 导入任务书
export function importTaskBook(parameter) {
  return request({
    url: api.importTaskBook,
    method: 'post',
    data: parameter
  })
}
// 项目任务书默认关键节点
export function taskBookDefaultKeyNode(parameter) {
  return request({
    url: api.taskBookDefaultKeyNode,
    method: 'post',
    data: parameter
  })
}
// 项目任务书默认专利指标
export function taskBookDefaultPatent(parameter) {
  return request({
    url: api.taskBookDefaultPatent,
    method: 'post',
    data: parameter
  })
}
// 项目任务书默认标准化指标
export function taskBookDefaultStandardIndex(parameter) {
  return request({
    url: api.taskBookDefaultStandardIndex,
    method: 'post',
    data: parameter
  })
}
// 获取任务书默认研发手段提升指标
export function taskBookDefaultDigitalIndex(parameter) {
  return request({
    url: api.taskBookDefaultDigitalIndex,
    method: 'post',
    data: parameter
  })
}
// 项目任务书默认预算条目
export function taskBookDefaultBudget(parameter) {
  return request({
    url: api.taskBookDefaultBudget,
    method: 'post',
    data: parameter
  })
}
//  项目任务书默认进度计划
export function taskBookDefaultSchedule(parameter) {
  return request({
    url: api.taskBookDefaultSchedule,
    method: 'post',
    data: parameter
  })
}
 
// 获取项目进度计划
export function getTaskBookSchedulePlan(parameter) {
  return request({
    url: api.getTaskBookSchedulePlan,
    method: 'post',
    data: parameter
  })
}
// 获取项目预算
export function getProjectBudget(parameter) {
  return request({
    url: api.getProjectBudget,
    method: 'post',
    data: parameter
  })
}
// 获取项目进成员
export function getTaskBookNumber(parameter) {
  return request({
    url: api.getTaskBookNumber,
    method: 'post',
    data: parameter
  })
}
// 项目列表表头
export function showTaskBookInfoTable(parameter) {
  return request({
    url: api.showTaskBookInfoTable,
    method: 'post',
    data: parameter
  })
}
// 项目列表表格
export function getTaskBookByProject(parameter) {
  return request({
    url: api.getTaskBookByProject,
    method: 'post',
    data: parameter
  })
}
// 编辑任务书权限
export function hasEditTaskBookPermission(parameter) {
  return request({
    url: api.hasEditTaskBookPermission,
    method: 'post',
    data: parameter
  })
}
// 创建任务书权限
export function hasCreatePermission(parameter) {
  return request({
    url: api.hasCreatePermission,
    method: 'post',
    data: parameter
  })
}
// 删除任务书权限
export function hasDeletePermission(parameter) {
  return request({
    url: api.hasDeletePermission,
    method: 'post',
    data: parameter
  })
}
// 下载任务书模板 
export function downloadTaskBookTemplate(parameter) {
  return request({
    url: api.downloadTaskBookTemplate,
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 下载专利模板
export function downloadPatentLayoutTemplate(parameter) {
  return request({
    url: api.downloadPatentLayoutTemplate,
    method: 'post',
    data: parameter,
    responseType: 'blob'
  })
}
// 创建项目任务书根据不同项目类型显示信息
export function createTaskBookShowTable(parameter) {
  return request({
    url: api.createTaskBookShowTable,
    method: 'post',
    data: parameter
  })
}
export function deleteTaskBook(parameter) {
  return request({
    url: api.deleteTaskBook,
    method: 'post',
    data: parameter
  })
}
export function getAllRoles(parameter) {
  return request({
    url: api.getAllRoles,
    method: 'post',
    data: parameter
  })
}
// 获取任务书关键节点
export function getTaskBookKeyNode(parameter) {
  return request({
    url: api.getTaskBookKeyNode,
    method: 'post',
    data: parameter
  })
}
// 导出计划关键节点
export function importPlanKeyNode(parameter) {
  return request({
    url: api.importPlanKeyNode,
    method: 'post',
    data: parameter
  })
}
// 获取项目默认成员
export function getTaskBookDefaultNumber(parameter) {
  return request({
    url: api.getTaskBookDefaultNumber,
    method: 'post',
    data: parameter
  })
}
// 获取任务书专利布局
export function getTaskBookPatentLayout(parameter) {
  return request({
    url: api.getTaskBookPatentLayout,
    method: 'post',
    data: parameter
  })
}
// 获取仿真分析项
export function getTaskBookAnalysis(parameter) {
  return request({
    url: api.getTaskBookAnalysis,
    method: 'post',
    data: parameter
  })
}
// 搜索指标模板
export function searchIndexTemplate(parameter) {
  return request({
    url: api.searchIndexTemplate,
    method: 'post',
    data: parameter
  })
}
// 指标插入模板 指标类别下拉框
export function getSubTypes(parameter) {
  return request({
    url: api.getSubTypes,
    method: 'post',
    data: parameter
  })
}
// 导入专利布局
export function importPatentLayout(parameter) {
  return request({
    url: api.importPatentLayout,
    method: 'post',
    data: parameter
  })
}
// 获取任务书主要指标
export function getTaskBookMainIndex(parameter) {
  return request({
    url: api.getTaskBookMainIndex,
    method: 'post',
    data: parameter
  })
}
// 获取任务书专利指标
export function getTaskBookPatentIndex(parameter) {
  return request({
    url: api.getTaskBookPatentIndex,
    method: 'post',
    data: parameter
  })
}
// 获取任务书数字化提升指标
export function getTaskBookDigitalUpgradeIndex(parameter) {
  return request({
    url: api.getTaskBookDigitalUpgradeIndex,
    method: 'post',
    data: parameter
  })
}
// 获取任务书标准化指标
export function getTaskBookStandardIndex(parameter) {
  return request({
    url: api.getTaskBookStandardIndex,
    method: 'post',
    data: parameter
  })
}
// 获取任务书试验检测指标
export function getTaskBookTestDetection(parameter) {
  return request({
    url: api.getTaskBookTestDetection,
    method: 'post',
    data: parameter
  })
}
// 预览任务书
export function taskBookPreview(parameter) {
  return request({
    url: api.preview,
    method: 'post',
    data: parameter,
    responseType: 'blob'
  })
}
// 创建任务书
export function taskBookCreate(parameter) {
  return request({
    url: api.create,
    method: 'post',
    data: parameter
  })
}
// 修改任务书
export function taskBookEdit(parameter) {
  return request({
    url: api.edit,
    method: 'post',
    data: parameter
  })
}
// 历史版本
export function getVersionHistory(parameter) {
  return request({
    url: api.getVersionHistory,
    method: 'post',
    data: parameter
  })
}
// 获取任务书附件信息
export function TaskBookAttachmentInfo(parameter) {
  return request({
    url: api.TaskBookAttachmentInfo,
    method: 'post',
    data: parameter
  })
}
// 下载任务书附件
export function downloadAttachmentFile(parameter) {
  return request({
    url: api.downloadAttachmentFile,
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
// 重新电子签名
export function reEsignature(parameter) {
  return request({
    url: api.reEsignature,
    method: 'post',
    data: parameter
  })
}
// 修订
export function reviseTaskBook(parameter) {
  return request({
    url: api.reviseTaskBook,
    method: 'post',
    data: parameter
  })
}
// 撤销检出项目任务书
export function undoCheckOut(parameter) {
  return request({
    url: api.undoCheckOut,
    method: 'post',
    data: parameter
  })
}
// 起草人身份操作
export function creatorMake(parameter) {
  return request({
    url: api.creatorMake,
    method: "post",
    data: parameter,
  });
}
//  获取获取仿真分析项列表
export function getAnalysisItems(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/sdm/getAnalysisItems',
    method: 'post',
    data: parameter
  })
}